/*
 * @Author: your name
 * @Date: 2021-09-20 10:07:11
 * @LastEditTime: 2021-09-20 10:12:50
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \bigdate\src\ntils\index.ts
 */
export const withInstall = <T>(component: T, alias?: string) => {
    const comp = component as any
    // 组件挂载
    comp.install = (app: App) => {
        app.component(comp.name || comp.displayName, component)
        if (alias) {
            app.config.globalProperties[alias] = component
        }
    }
    return component as T & Plugin
}